package com.ems.util;

/**
 * @Author: Wuzh
 * @Description:PCS和BMS警告
 * @Date Created in 23:17 2024-04-24
 * @return
 */
public enum PCSEnum {


    /**
     * else if (pointId == EmsPointUtil.PCS_IGBT_HARD_OVER_CURRENT_FLAG) {
     *                 //IGBT 硬件过流标志，value为1则有警告
     *                 if (value == 1) {
     *                     parsePcsAlarm(alarmVos, pointId, deviceAddress);
     *                 }
     *             } else if (pointId == EmsPointUtil.PCS_BUS_HARD_OVER_VOLTAGE_FLAG) {
     *                 if (value == 1) {
     *                     parsePcsAlarm(alarmVos, pointId, deviceAddress);
     *                 }
     *             } else if (pointId == EmsPointUtil.PCS_POWER_MODULE_CURRENT_LIMIT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MODULE_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_24_V_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_FAN_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_CONNECT_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_LIGHT_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_MODULE_OVER_TEMP_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MODULE_OVER_TEMP_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_15_V_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_SYSTEM_FIRE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_BATTERY_CONNECT_POINT_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_OVERLOAD_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_A_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_B_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_C_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_A_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_B_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_C_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_OVER_POWER_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_UN_POWER_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_SEQUENCE_ERROR_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_A_SEQUENCE_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_B_SEQUENCE_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_C_SEQUENCE_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_VOLTAGE_IMBALANCE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_CURRENT_IMBALANCE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_LOSS_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_N_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_EXPECT_BUS_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_EXPECT_BUS_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_UNCONTRO_CURRENT_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_UNCONTRO_CURRENT_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_RUN_BUS_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_RUN_BUS_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_UNBALANCE_BUS_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_BATTERY_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_CURRENT_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_BATTERY_OVER_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_DC_PRE_CHARGE_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_DC_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MODULE_SOFT_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_BATTERY_UNDER_CONNECT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_OVER_TIME_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_A_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_B_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_C_OVER_CURRENT_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_AD_ZERO_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_BMS_BATTERY_SYSTEM_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_STS_COMM_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_BMS_COMM_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_SALVE_CAN_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_EMS_COMM_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_CLOSE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_OPEN_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_CLOSE_ERROR_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_PRE_CHARGE_OPEN_ERROR_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MASTER_CLOSE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MASTER_OPEN_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MASTER_CLOSE_ERROR_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_MASTER_OPEN_ERROR_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_AC_MASTER_CONNECT_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_DC_OPEN_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_INVERTER_A_OVER_VOLTAGE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_INVERTER_B_OVER_VOLTAGE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_INVERTER_C_OVER_VOLTAGE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_POWER_GRID_IS_LAND_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_SYSTEM_RESONANCE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_SOFT_OVER_VOLTAGE_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_HIGH_VOLTAGE_OVER_TIME_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_INVERTER_A_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_INVERTER_B_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_INVERTER_C_UN_VOLTAGE_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_OFF_GRID_NO_SIGNAL_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_OFF_ROAD_SIGNAL_FAIL_FLAG) {
     *
     *             } else if (pointId == EmsPointUtil.PCS_LOW_VOLTAGE_OVER_TIME_FLAG) {
     *
     *             }
     */


    //PCS故障
    IGBT_FAIL(20007, "IGBT硬件过流"),
    BUS_OVER_VOLTAGE_FAIL(20008, "母线硬件过压"),
    RATE_MODULE_FAIL(20009, "功率模块逐波限流"),
    MODULE_CURRENT_FAIL(20010, "平衡模块硬件过流"),
    SOURCE_24_FAIL(20011, "24V电源故障"),
    FAN_FAIL(20012, "风扇故障"),
    CONNECT_FAIL(20013, "连接故障"),
    LIGHT_FAIL(20014, "防雷器故障"),
    POWER_MODULE_OVER_TEMP_FAIL(20015, "防雷器故障"),
    BALANCE_MODULE_OVER_TEMP_FAIL(20016, "平衡模块过温"),
    SOURCE_15_FAIL(20017, "15V电源故障"),
    SYSTEM_FIRE_FAIL(20018, "系统火警故障"),
    BATTERY_CONNECT_FAIL(20019, "电池干接点故障"),
    OVER_FAIL(20020, "过载故障标志"),
    A_OVER_FAIL(20021, "A相过压故障"),
    B_OVER_FAIL(20022, "B相过压故障"),
    C_OVER_FAIL(20023, "C相过压故障"),
    A_UN_FAIL(20024, "A相欠压故障"),
    B_UN_FAIL(20025, "B相欠压故障"),
    C_UN_FAIL(20026, "C相欠压故障"),
    POWER_GRID_OVER_FAIL(20027, "电网过频"),
    POWER_GRID_UN_FAIL(20028, "电网欠频"),
    GRID_PHASE_INDEX_ERROR(20029, "电网相序错误"),
    A_SOFT_OVER_CURRENT(20030, "A相软件过流"),
    B_SOFT_OVER_CURRENT(20031, "B相软件过流"),
    C_SOFT_OVER_CURRENT(20032, "C相软件过流"),
    POWER_GRID_VOLTAGE_FAIL(20033, "电网电压不平衡"),
    UNBALANCE_GRID_CURRENT_FAIL(20034, "电网电流不平衡"),
    POWER_GRID_LOSS(20035, "电网缺相"),
    N_OVER_CURRENT_FAIL(20036, "N 线过流"),
    OVER_BUS_VOLTAGE_FAIL(20037, "预充母线过压"),
    UN_BUS_VOLTAGE_FAIL(20038, "预充母线欠压"),
    PRE_BUS_OVER_FAIL(20039, "不控整流母线过压"),
    PRE_BUS_UN_FAIL(20040, "不控整流母线欠压"),
    RUN_BUS_OVER_FAIL(20041, "运行母线过压"),
    RUN_BUS_UN_FAIL(20042, "运行母线欠压"),
    BUS_NOT__FAIL(20043, "正负母线不平衡"),
    BATTERY_UN_VOLTAGE_FAIL(20044, "电池欠压"),
    CURRENT_MODEL_UN_VOLTAGE_FAIL(20045, "电流模式母线欠压"),
    BATTERY_OVER_VOLTAGE_FAIL(20046, "电池过压"),
    DC_OVER_CURRENT_FAIL(20047, "直流预充电过流"),
    DC_OVER_CURRENT1_FAIL(20048, "直流过流"),
    BATTERY_CONN_FAIL(20050, "电池反接"),
    OVER_TIME_FAIL(20051, "预充电超时"),
    A_OVER_TIME_FAIL(20052, "预充电A相过流"),
    B_OVER_TIME_FAIL(20053, "预充电B相过流"),
    C_OVER_TIME_FAIL(20054, "预充电C相过流"),
    AD_FAIL(20055, "AD采样零漂故障"),
    BMS_FAIL(20056, "BMS电池系统故障"),
    STS_FAIL(20057, "STS通信故障"),
    BMS_1_FAIL(20058, "BMS通讯故障"),
    CAN_FAIL(20059, "从模块CAN通信故障"),
    EMS_FAIL(20060, "EMS通信故障"),
    CLOSE_FAIL(20061, "预充电继电器闭合失败"),
    DIS_OPEN_FAIL(20062, "预充电继电器断开失败"),
    CLOSE_ERROR_FAIL(20063, "预充电继电器闭合状态错误"),
    DIS_ERROR_FAIL(20064, "预充电继电器断开状态错误"),
    MAIN_CLOSE_ERROR_FAIL(20065, "主继电器闭合失败"),
    MAIN_DIS_ERROR_FAIL(20066, "主继电器断开失败"),
    MAIN_MAIN_CLOSE_FAIL(20067, "主继电器闭合状态错误"),
    MAIN_MAIN_ERROR_FAIL(20068, "主继电器断开状态错误"),
    MAIN_MAIN_ERROR1_FAIL(20069, "交流主继电器粘连故障"),
    MAIN_MAIN_ERROR2_FAIL(20070, "直流继电器开路故障"),
    MAIN_A_FAIL(20071, "逆变电压A相过压故障"),
    MAIN_B_FAIL(20072, "逆变电压B相过压故障"),
    MAIN_C_FAIL(20073, "逆变电压C相过压故障"),
    MAIN_20074_FAIL(20074, "电网孤岛故障"),
    MAIN_20075_FAIL(20075, "系统谐振故障"),
    MAIN_20076_FAIL(20076, "软件过压过流"),
    MAIN_20077_FAIL(20077, "高电压穿越超时故障"),
    MAIN_20078_FAIL(20078, "逆变电压A相欠压故障"),
    MAIN_20079_FAIL(20079, "逆变电压B相欠压故障"),
    MAIN_20080_FAIL(20080, "逆变电压C相欠压故障"),
    MAIN_20081_FAIL(20081, "离网无同步信号故障"),
    MAIN_20082_FAIL(20082, "离网短路故障"),
    MAIN_20083_FAIL(20083, "低电压穿越超时故障"),
    ;

    // 错误警告码
    private Integer code;
    // 错误警告标题
    private String title;

    PCSEnum(Integer code, String title) {
        this.code = code;
        this.title = title;
    }


    public static String getTitle(Integer code) {
        PCSEnum[] PCSEnums = values();
        for (PCSEnum PCSEnum : PCSEnums) {
            if (PCSEnum.getCode() == code) {
                return PCSEnum.getTitle();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

}
